﻿@using Emoney.UserTraining.Model;
@using Emoney.UserTraining.BLL;
@using Emoney.UserTraining.Comm;
@{
    ViewBag.Title = "lstrain";
    Layout =  "~/Views/Shared/_TrainLayout.cshtml";
    List<Traning_NetworkMeeting> lst = (List<Traning_NetworkMeeting>)ViewBag.tnm;
    var count = lst.Count;
}
<div id="menuflag" style="display: none">3</div>
<!--菜单切换效果使用-->
<div class="content" style="padding: 15px 0 0 35px;">
    <div class="history1" id="scrollBox1">
        <div class="arrowleft" style="display:none;">
            <a href="#" onfocus="this.blur()">
                <img src="@StringTools.GetStaticFile("Images/Train/images/img_arrowLeft.jpg")" /></a>
        </div>
        <div class="arrowright" style=" right:30px;">
            <a href="#" onfocus="this.blur()">
                <img src="@StringTools.GetStaticFile("Images/Train/images/img_arrowRight.jpg")" /></a>
        </div>
        <div class="scrollCnt">
            @Html.Raw(ViewBag.tjstr)
        </div>
    </div>
    <div class="history2">
        <div class="more"><a href="http://v.emoney.cn/xyvideo/index" target="_blank" style="text-decoration: underline;">查看更多</a></div>
        <div class="tablestyle t1">
            <div class="topheader">
                <div class="tableitem" style="color: black;">
                    <div class="time1">培训时间</div>
                    <div class="theme2">主题</div>
                    <div class="style">类型</div>
                    <div class="name1">讲师</div>
                </div>
            </div>
            @{
                int idex = 1;    
            }
            @if (ViewBag.tnm != null)
            {
                foreach (Traning_NetworkMeeting c in ViewBag.tnm)
                {
                    string style = "";
                    if (idex % 2 != 0)
                    {
                        style = "tableitem";
                    }
                    else
                    {
                        style = "tableitem bg1";
                    }
                <div class="@style">
                    <div class="time1">
                        <b>@c.class_date.ToString("M/d")&nbsp;@string.Format("{0:t}", DateTime.Parse(c.class_date.ToString()))-@string.Format("{0:t}", c.endDate)</b>
                    </div>
                    <div class="theme2">@StringTools.SubStr(c.mtg_name, 11)</div>
                    <div class="style">@c.meeting_type</div>
                    <div class="name1">@c.txtteachar</div>
                    <div class="opertion">
                        <a href="@c.video_url" target="_blank" onclick="AddClickCount('videoTip','课程回放','')">
                            <img src="@StringTools.GetStaticFile("Images/Train/images/btn5.jpg")"  state="true"/></a>
                    </div>
                </div>
                 
                    idex++;
                }

            }

        </div>
    </div>
    @Html.Partial("dbqq")
</div>
<script type="text/javascript">
    $(function () {
        var count = "@count";
        var $sclBox = $("#scrollBox1"),
            $sclCnt = $(".scrollCnt", $sclBox),
            $goL = $(".arrowleft", $sclBox),
            $goR = $(".arrowright", $sclBox);
        $tdnum = $("table tbody tr td", $sclBox).size();
        $sclCnt.find("table").css({ "width": 635 * $tdnum + "px" });

        if (count == "0") {
            $goR.hide();
            $goL.hide();
        }
        $goL.click(function () {
            tb_scroll(-1);
        });
        $goR.click(function () {
            tb_scroll(+1);
        });

        if ($tdnum == 1) {
            $goL.hide(); $goR.hide();
        }
          

       function tb_scroll(DD) {

            if (!$sclCnt.is(":animated")) {
                $sclCnt.animate({ scrollLeft: ($sclCnt.scrollLeft() + DD * 635) + "px" }, 300,"",function(){
                    if (($sclCnt[0].scrollWidth-635) == $sclCnt.scrollLeft()){
                        $goR.hide();
                        $goL.show();
                    } else if (0 == $sclCnt.scrollLeft()) {
                        $goL.hide();
                        $goR.show();
                    } else {
                        $goR.show();
                        $goL.show();
                    }
                });
            }
        }
    });

</script>






